package com.yuewen.test3;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;

/**
 * Created by liwei.b on 2017/6/22.
 */
@Aspect
public class LoggerAspect {
    @Around(value = "execution(* com.yuewen.test3..*.*(..)) && @annotation(loggable)")
    public Object aaaa(ProceedingJoinPoint join, Loggable loggable) throws Throwable {
        System.out.println("class name=" + loggable.className() + ", method name=" + loggable.methodName());
        join.proceed();
        return "23234";
    }

    @Around(value = "execution(* com.yuewen.test1..*.*(..)) && @annotation(loggable)")
    public Object bbbb(ProceedingJoinPoint join, Loggable loggable) throws Throwable {
        System.out.println("class name=" + loggable.className() + ", method name=" + loggable.methodName());
        return join.proceed();
    }
}
